<%@ page import="java.util.List" %>
<%@ page import="com.lanou3g.hw0518.pojo.User" %>
<%@ page import="java.util.Arrays" %>
<%@ page import="java.util.Set" %><%--
  Created by IntelliJ IDEA.
  User: dllo
  Date: 18/5/19
  Time: 上午10:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table>
    <tr>
        <td>序号</td>
        <td>用户名</td>
        <td>昵称</td>
        <td>性别</td>
        <td>爱好</td>
    </tr>
    <%
        List<User>users= (List<User>) request.getAttribute("users");
        Set<String> loginUsers = (Set<String>) application.getAttribute("loginUsers");
        int i=0;
        for (User user : users) {
            i++;
            %>
    <tr><td><%=i%></td>
        <td><%=user.getUsername()%></td>
        <td><%=user.getNickName()%></td>
        <td><%=user.getGender()%></td>
        <td><%=Arrays.toString(user.getHobbies().toArray())%></td>
        <td><%=loginUsers.contains(user.getUsername())%></td>
    </tr>
    <%
        }
    %>
</table>
</body>
</html>
